feat: Add evaluation harness battery for retrieval quality measurement #21
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
This PR introduces the eval harness battery, an optional module for systematically measuring retrieval quality in RAG pipelines. The harness allows users to define test datasets with ground truth relevance labels, run retrieval against them, and produce metrics (precision, recall, MRR) that quantify performance over time.
What's included
Core eval modules (
packages/unrag/registry/eval/)dataset.ts- Dataset parsing and validation for the eval dataset formatmetrics.ts- Computation of retrieval metrics at K (precision, recall, MRR)runner.ts- Orchestrates eval runs including document ingestion, query execution, and optional rerankingreport.ts- Report generation in JSON and Markdown formats, including diff support for comparing runsCLI integration
unrag addcommand to supportbattery evalinstallationDocumentation (
apps/web/content/docs/eval/)Tests
add-battery-eval.test.ts- CLI battery installationeval-dataset.test.ts- Dataset parsingeval-metrics.test.ts- Metrics computationeval-report-diff.test.ts- Report diffingeval-runner-thresholds.test.ts- Runner threshold enforcementUI components
SystemBannercomponent to display experimental feature warnings in docsNotes
specs/EVAL_HARNESS_SPEC.md) as the feature is now implemented.